<?php
// 用户模型
class SchoolModel extends CommonModel {
	public $_validate	=	array(
		array('sName','require','单位名称必须'),
		array('sName','','单位名称已经存在',self::EXISTS_VAILIDATE,'unique',self::MODEL_INSERT),
		array('sType','require','单位类型必须'),
		array('sStaffCount','number','单位人数必须为数字',2),
		array('sStudentCount','number','学生人数必须为数字',2),
	);

	public $_auto		=	array(
		array('update_time','time',self::MODEL_UPDATE,'function'),
	);
	
	/*//在新增单位的同时，在不动产表里同时新增一个相应单位id的数据，不动产的管理没有新增，只有修改删除
	protected function _after_insert($data,$options){
		$bdc = M('bdc');
		$data1['dwid'] = $data['id'];
		$bdc->add($data1);
		
	}
	protected function _after_delete($data,$options){
		$bdc = M('bdc');
		$bdc->where('dwid in ('.implode(",",$options['where']['id'][1]).')')->delete();
		//echo $bdc->getLastSql();
	}*/
	
}
?>